#include "language.h"

extern 
char *lan;

void init(){
}

int Lan_open(const char * path){
    int len;
    char tmp[512];
    FILE*file;
    file=fopen(path,"r");
    fseek(file,SEEK_END);
    len=ftell(file);
    fseek(file,SEEK_SET);
    fread(&tmp,len,1,path);
    fclose(file);
    sift(tmp,0);
    lan=(char*)malloc(sizeof(tmp));
    strcpy(lan,tmp);
    init();
}



char *Lan_getName(){
    return splitn(lan,'\n');
}



char *Lan_getItem(const char *label){
    char *ep,*tmp;
    size_t elen;
    int len=strlen(label);
    ep=strchr(p,label);
    ep+=len+2;
    
    elen=(strchr(ep,'\n')-ep)+1;
    tmp=(char*)malloc(elen);
    strcpy(tmp,ep)
    tmp[elen]=0;
    return tmp;
}


void Lan_term(){
   free(lan);
}